<%@ page import="cn.gudian.cms.Admin.AdminRole" %>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  <meta name="layout" content="main"/>
  <title><g:message code="adminRole.create" default="Create AdminRole"/></title>
</head>
<body>
<div class="nav">
  <span class="menuButton"><a class="home" href="${createLinkTo(dir: '')}"><g:message code="home" default="Home"/></a></span>
  <span class="menuButton"><g:link class="list" action="list"><g:message code="adminRole.list" default="AdminRole List"/></g:link></span>
</div>
<div class="body">
  <h1><g:message code="adminRole.create" default="Create AdminRole"/></h1>
  <g:if test="${flash.message}">
    <div class="message"><g:message code="${flash.message}" args="${flash.args}" default="${flash.defaultMessage}"/></div>
  </g:if>
  <g:hasErrors bean="${adminRoleInstance}">
    <div class="errors">
      <g:renderErrors bean="${adminRoleInstance}" as="list"/>
    </div>
  </g:hasErrors>
  <g:form action="save" method="post">
    <div class="dialog">
      <table>
        <tbody>

        <tr class="prop">
          <td valign="top" class="name">
            <label for="name"><g:message code="adminRole.name" default="Name"/>:</label>
          </td>
          <td valign="top" class="value ${hasErrors(bean: adminRoleInstance, field: 'name', 'errors')}">
            <g:textField name="name" value="${fieldValue(bean: adminRoleInstance, field: 'name')}"/>

          </td>
        </tr>

        <tr class="prop">
          <td valign="top" class="name">
            <label for="roles"><g:message code="adminRole.roles" default="Roles"/>:</label>
          </td>
          <td valign="top" class="value ${hasErrors(bean: adminRoleInstance, field: 'roles', 'errors')}">
            <g:each status="i" in="${grailsApplication.config.cms.admin.roles}" var="roles">
              <g:if test="${roles.value==0}">
                <p>${roles.key}:<p>
              </g:if>
              <g:else>
                <input name='roles' type='checkbox' id='roles'
                        value='${roles.value}'> ${roles.key}(${roles.value})<br>
              </g:else>

            </g:each>
          </td>
        </tr>

        </tbody>
      </table>
    </div>
    <div class="buttons">
      <span class="button"><g:submitButton name="create" class="save" value="${message(code: 'create', 'default': 'Create')}"/></span>
    </div>
  </g:form>
</div>
</body>
</html>
